<script setup>
	import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
	import {
		store
	} from '@/store/index.js'
	onLaunch(() => {
		console.log('App Launch')
		// 尝试去获取本地的 token 和用户信息，填充到 store 中
		if(!store.token) {
			let token = uni.getStorageSync('token')
			if(token) {
				store.setToken(token)
				let userStr = uni.getStorageSync('userInfo')
				if(userStr) {
					let userInfo = JSON.parse(userStr)
					if(userInfo.userId) {
						store.setUserInfo(userInfo)
					}
				}
			}
		}
	})
	onShow(() => {
		console.log('App Show');
	})
	onHide(() => {
		console.log('App Hide');
	})
</script>

<style lang="scss">
	@import "@/uni_modules/uview-plus/index.scss";
	@import "@/static/css/mystyle.css";
	/*每个页面公共css */
	
</style>
